package com.example.demo.controller;


import com.example.demo.entity.Shop;
import com.example.demo.service.IShopService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bw
 * @since 2022-01-07
 */
@Controller
@RequestMapping("/shop")
public class ShopController {
    @Autowired
    IShopService iShopService;
   @RequestMapping("getpage")
    public Object getList(Model model,Shop shop, @RequestParam(defaultValue = "1") Integer pageNum,@RequestParam(defaultValue = "3") Integer pageSize){
       PageInfo<Shop> pg=iShopService.listpage(shop,pageNum,pageSize);
       model.addAttribute("pg",pg);
      return "list";
   }
}
